{template 'common/header'}
<ul class="nav nav-tabs">
    <li {if $op == 'display'} class="active"{/if}><a href="{php echo $this->createWebUrl('articledeliverymanage', array('op' => 'display'))}">物品放行管理说明</a></li>

    <li {if $op == 'apply'} class="active"{/if}><a href="{php echo $this->createWebUrl('articledeliverymanage', array('op' => 'apply'))}">物品放行申请记录</a></li>

</ul>
<style>
    .label{line-height: 2}
    .danger{position: relative}
</style>
{if $op == 'display'}


<div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">物品放行申请记录</div>
    <div class="panel-body">
        <p>切克切克~</p>
    </div>
</div>

{elseif $op == 'apply'}
<div class="panel panel-default">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="./index.php" method="get" class="form-horizontal" role="form" id="form">
            <input type="hidden" name="c" value="site">
            <input type="hidden" name="a" value="entry">
            <input type="hidden" name="m" value="orange_storemanage">
            <input type="hidden" name="do" value="storesort">
            <input type="hidden" name="token" value="{$_W['token']}">
            <input type="hidden" name="op" value="storebrandmanage">
            <div class="form-group">

                <label class="col-xs-12 col-sm-3 col-md-2 control-label">申请人姓名[模糊搜索]</label>

                <div class="col-sm-8 col-xs-12">
                    <input type="text" class="form-control" name="keyword" value="{$_GPC['keyword']}" />
                </div>



                <div class="pull-right col-xs-12 col-sm-3 col-md-2 col-lg-2">
                    <input type="submit" class="btn btn-primary span3" name="submit" value="搜索" />
                </div>
            </div>
        </form>
    </div>
</div>
<div class="panel panel-default">
    <div class="panel-body table-responsive">
        <table class="table table-hover">
            <thead>
            <tr>
                <th width="50">ID</th>
                <th width="180">申请人姓名</th>
                <th width="180">申请人手机号</th>
                <th width="180">申请人车牌</th>

                <th width="300">起止时间</th>
                <th width="180">物品图片</th>
                <th width="180">状态</th>
                <th width="150">创建时间</th>

                <!--<th width="140">状态</th>-->
                <!--<th width="80" class="text-right">操作</th>-->
            </tr>
            </thead>
            {loop $list $row}
            <tr>
                <td>
                    {$row['id']}
                </td>

                <td>
                    {$row['sponsor_name']}
                </td>

                <td>
                    {$row['sponsor_mobile']}
                </td>

                <td>
                    {$row['sponsor_platenumber']}
                </td>

                <td>
                    {php echo date('Y-m-d', $row['start_time']). '~' . date('Y-m-d', $row['end_time']);}
                </td>

                <td>
                    {$row['article_pic']}
                </td>



                <td class="text-left">

                    {if $row['status'] == 1}
                    <a href="{php echo $this->createWebUrl('CheckDeliveryApply',array('applyid'=>$row['id'],'uid'=>$row['uid'],'op'=>'display'));}"data-toggle="modal" data-target="#myModal">
                        <span class="label label-primary">待审核</span>
                    </a>
                    {elseif $row['status'] == 2}
                    <span class="label label-info">未使用</span>
                    {elseif $row['status'] == 3}
                    <span class="label label-info">已使用</span>
                    {elseif $row['status'] == 4}
                    <span class="label label-info">已过期</span>
                    {/if}
                </td>

                <td>{php echo date('Y-m-d H:i', $row['create_time']);}</td>

                <!--
                <td class="text-right">
                    <a href="javascript:void(0);" attr-id="{$row['id']}" onclick="deleteSort(this)" id="js-delete" title="" class="btn btn-default">删除</a>
                </td>
                    !-->
                {/loop}
        </table>
    </div>
</div>
{$pager}


<!--审核会员modal-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

        </div>
    </div>
</div>


<script type="text/javascript">

    function deleteSort(_this) {
        var r=confirm("是否确认删除?");
        if(r == true)
        {
            var id = $(_this).attr('attr-id');
            $.post("{php echo $this->createWeburl('storebrandmanage', array('op' => 'delete'))}",
                {'id' : id},
                function(data) {
                    var data = JSON.parse(data);
                    if(data.errCode == 0){
                        util.message(data.msg, 'refresh', 'success');
                    }else{
                        util.message(data.msg, 'refresh', 'error');
                    }
                });
        }
    }

</script>
{/if}